package cmpe226.spring2011.project1.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;

@Entity
public class Symbol {
	
	@Id
	private String symbol;
	
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name = "symbol")
	private List<Quote> quotes;
	
	public Symbol(String sym, List<Quote> quotelist) {
        symbol = sym;
        quotes = quotelist;
    }
	
    public Symbol() {
        quotes = new ArrayList<Quote>();
    }

    public String getSymbol() {
		return symbol;
	}
	public void setSymbol(String symbol) {
		this.symbol = symbol;
	}
	public List<Quote> getQuotes() {
		return quotes;
	}
	public void setQuotes(List<Quote> quotes) {
		this.quotes = quotes;
	}

}
